//
//  QrCodeManager+Rx.swift
//  YYDSDemo
//
//  Created by linjw on 2020/3/10.
//

import Foundation
import RxSwift
import RxCocoa

extension Reactive where Base: JWQRCodeManager {
    
    func rxReaultAction() -> Observable<String?> {
        
        return Observable<String?>.create { [weak base] observer -> Disposable in
            
            base?.resultAction = { text in
                observer.onNext(text)
            }
            
            return Disposables.create { observer.onCompleted() }
        }
    }
    
}

